<HTML>
<HEAD>
<!-- Created by texi2html 1.56k + clip patches and <A href="http://www.clip.dia.fi.upm.es/Software">lpdoc</A> from WebDB.texi on 8 January 2003 -->

<LINK rel="stylesheet" href="WebDB.css" type="text/css">
<TITLE>The WebDB WWW Database Interface               - Installing WebDB</TITLE>
</HEAD>
<BODY> 
Go to the <A HREF="WebDB_1.html">first</A>, <A HREF="WebDB_3.html">previous</A>, <A HREF="WebDB_5.html">next</A>, <A HREF="WebDB_9.html">last</A> section, <A HREF="WebDB_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC20" HREF="WebDB_toc.html#TOC20">Installing WebDB</A></H1>

<P>
 



<UL>
<LI><A HREF="WebDB_4.html#SEC21">Installation steps</A>
<LI><A HREF="WebDB_4.html#SEC22">Usage Summary</A>
<LI><A HREF="WebDB_4.html#SEC23">Customization</A>
<LI><A HREF="WebDB_4.html#SEC24">Troubleshooting</A>
</UL>



<H2><A NAME="SEC21" HREF="WebDB_toc.html#TOC21">Installation steps</A></H2>
<P>
The following provides the different steps which are necessary to take to make a complete installation of <CODE>WebDB</CODE> 



<UL>

<LI>Uncompress (using <CODE>gunzip</CODE>) and unpackage (using <CODE>tar</CODE> <CODE>-xpf</CODE>) the distribution in a suitable directory.

<LI>Edit the <CODE>SETTINGS.pl</CODE> file and change things to suit your installation. Note that some directories must have certain permissions.

<LI>In a shell, cd to the WebDB root and run <CODE>lpmake install</CODE>. This creates the CGI executables, creates the target directories, and copies several <CODE>files</CODE> to their destinations in these directories. In order to ease this process it is highly recommendable both ciaoc and lpmake are reachable through the PATH environment variable.

<LI>cd to the <CODE>DBDESC</CODE> directory defined in <CODE>SETTINGS.pl</CODE>. Using the file <CODE>dbserver:dbtables_desc.pl</CODE> as a template, create a new one in this directory defining the relations/fields of your database. Note that Prolog syntax must be respected in this file. This can also be done through WebDB's administration interface.

<LI>PERMISSIONS. The installation processoffers a default configuration but these are some hints you should bear in mind anyway:


<UL>

<LI>The directory <CODE>DBHOME/private</CODE> (<CODE>DBHOME</CODE> is defined in <CODE>SETTINGS.pl</CODE>) will contain the scripts which allow the querying and management of the database. You will probably want to protect it with an <CODE>HTTP password</CODE>. In the distribution directory <CODE>utils</CODE> you can find the source of a program for manipulating password files for <CODE>NCSA httpd</CODE>.

Ideally, <CODE>DBHOME/private</CODE> should not be readable by anyone (but needs to be readable by the httpd, of course). 

Besides, note that, in <CODE>SETTINGS.pl</CODE>, to prevent undesired downloading of the <CODE>DBDATA</CODE>, <CODE>DBDESC</CODE> and <CODE>DBTYPES</CODE> files it's quite advisable to set <CODE>DBDESCDATA</CODE> to some different directory from <CODE>DBHOME</CODE> which is not under the public_html directory tree. 

<LI>Check that your system's httpd configuration file allows the cgi executables (all ending in .cgi) located in <CODE>DBHOME</CODE> and <CODE>DBHOME/private</CODE> to be run from a browser. Also, the user under which the httpd is run needs to have write permission in <CODE>DBADD</CODE> and in directories <CODE>DBHOME/private</CODE>, <CODE>DBDESC</CODE> and <CODE>DBDATA</CODE>.

</UL>

<LI>You are done! If you want to delete temporary files created during the installation, run <CODE>make clean</CODE> in the source directory.

</UL>



<H2><A NAME="SEC22" HREF="WebDB_toc.html#TOC22">Usage Summary</A></H2>

<P>
A very brief summary of usage (you should consult the relevant sections of the manual for a full explanation): 



<UL>

<LI>To perform administration duties (i.e., modification/management of the database) open <CODE>DBURL/private/maintenance.html</CODE> (<CODE>DBURL</CODE> is defined in <CODE>SETTINGS.pl</CODE>). If the database server has not been started yet (which can be checked by seeing if a correct response is received following the link <EM>System Status</EM>) start one by selecting the link <EM>Start the System</EM>.

<LI>To consult the database as a common user (no modification allowed), open <CODE>DBURL/dbcommonselection.cgi</CODE>.

</UL>



<H2><A NAME="SEC23" HREF="WebDB_toc.html#TOC23">Customization</A></H2>
<P>
Extensive customization of the appearance of the database pages is possible: 



<UL>
<LI>The basic text messages used in the database can be changed from a browser, by following the corresponding link from <CODE>DBURL/private/maintenance.html</CODE> (or edit manually the file <CODE>DBDESC/dbserver:text_option-3.pl</CODE>).

<LI>The layout of the pages is determined by the HTML files in the <CODE>DBHOME</CODE> directory. You can change these files (between the body tags) to change the appearance of the HTML pages. The title of each template file explains what the template is used for, and lists the template variables between parenthesis. In these files, the template variables are written like this <CODE>&#60;V&#62;varname&#60;/V&#62;</CODE> if they appear in normal text or like <CODE>_varname</CODE>, if they appear as an attribute or attribute value of a tag. Note that all URLs must be relative to the <CODE>DBHOME</CODE> directory.

You can change these templates by hand or using an HTML editor. Beware, however, of WYSIWYG HTML editors! Always check that they have not arbitrarily changed attributes, tag ordering, etc. 

After changing some templates, you can load the new files into the running db server by selecting the appropriate link in the <CODE>maintenance page</CODE>. This will also recreate the maintenance page (remember to reload if the browser cache is activated). 
</UL>



<H2><A NAME="SEC24" HREF="WebDB_toc.html#TOC24">Troubleshooting</A></H2>
<P>
If an unexpected response is obtained, you may check the database server log file <CODE>DBHOME/private/dbserver.log</CODE>. For further, persistent problems subscribe to ciao-users@clip.dia.fi.upm.es{}


<P><HR><P>
Go to the <A HREF="WebDB_1.html">first</A>, <A HREF="WebDB_3.html">previous</A>, <A HREF="WebDB_5.html">next</A>, <A HREF="WebDB_9.html">last</A> section, <A HREF="WebDB_toc.html">table of contents</A>.
</BODY>
</HTML>
